/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import static cn.webrx.Util.pf;
import static java.lang.Math.random;

/**
 * <p>Project: jse2302 - Method3
 * <p>Powered by webrx On 2023-06-15 15:46:27
 * <p>Created by IntelliJ IDEA
 *
 * @author  webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Method3 {

    public static void tes(String[] args) {
        //m1(5);
        //m2(5);

        int n = 6;
        int js = 1;
        for (int i = 1; i <= n; i++) {
            js *= i;
        }
        System.out.println(js);

        System.out.println(js(6));

        System.out.println(sum(1.5,1.5));
    }

    static int sum() {
        return 0;
    }

    static int sum(int a, int b) {
        return a + b;
    }

    static int sum(int a, int b, int c) {
        return a + b + c;
    }

    static double sum(float a, float b) {
        return a + b;
    }

    static double sum(double a, double b) {
        System.out.println("double");
        return a + b;
    }

    public static void main(String[] args) {
        System.out.println(pf(6));

        System.out.println(random());

        System.out.println(Util.pf(3));

        System.out.println(random());
        //System.out.println(Math.round);

        int num1 = Math.round(1.5f);
        int num2 = (int)1.5f;
        System.out.println(num1);
        System.out.println(num2);


        //m2(5);

        System.out.println(js(6));

        System.out.println(sum(1.5,1.5));
    }

    static int js(int n) {
        if (n >= 1) {
            return n * js(n - 1);
        }
        return 1;
    }

    static void a() {
        a();
    }

    static void m2(int i) {
        if (i >= 1) {
            m2(--i);
            System.out.println(i + 1);
        }
    }

    static void m1(int i) {
        if (i >= 1) {
            System.out.println(i);
            m1(--i);
        }
    }
}
